From: Georges Basile Stavracas Neto Date: Tue, 29 Sep 2020 16:38:40 +0000 (-0300) Subject: workspacesView: Make sure to destroy non-existing workspaces X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~641 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=57f96b28ab50ec7b1d3ce6ba6e4d36124378c1b9;p=gnome-shell.git workspacesView: Make sure to destroy non-existing workspaces Even if they're in the end of the list. So far we've managed to not be affected by this bug because until GNOME 3.38, workspaces didn't have a background, and there was no way to navigate to these leftover workspaces, but with the proposed overview changes for GNOME 40 it'll be very much visible. Part-of: --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 1e8faf349..a7b3b878a 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -222,6 +222,11 @@ class WorkspacesView extends WorkspacesViewBase { } } + for (let j = this._workspaces.length - 1; j >= newNumWorkspaces; j--) { + this._workspaces[j].destroy(); + this._workspaces.splice(j, 1); + } + this._updateScrollPosition(); }